<template>
  <div class="main_welcome">
    <h2>欢迎使用小正Springboot快速开发框架</h2>
    <el-card class="box-main_card">
      <el-card class="box_card_info">
        <div>系统信息</div>
        <br />
        <el-link type="primary">{{CloudBase}}</el-link>
        <br />
        <el-link type="primary">{{CloudVer}}</el-link>
        <br />
        <el-link type="primary">{{UiVer}}</el-link>
        <br />
        <br />
        <div>
          服务端 CPU:
          <el-progress :percentage="CloudCPU"></el-progress>
        </div>
        <br />
        <div>
          服务端 内存:
          <el-progress :percentage="CloudMemory"></el-progress>
        </div>
      </el-card>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      CloudBase: "后端服务Base: " + this.$http.defaults.baseURL,
      CloudVer: "后端版本: 0.0.1",
      UiVer: "前端版本: 0.0.1",
      CloudCPU: 99,
      CloudMemory: 50,
    };
  },
  methods: {
    async getInfo() {
      const { data: res } = await this.$http.get("public/sys/info");
      this.CloudVer = "后端版本: " + res.data.systemVar;
    },
  },
  created() {
    this.getInfo();
  },
};
</script>

<style lang="less" scoped>
.main_welcome {
  height: 85%;
}
.box-main_card {
  height: 100%;
}
//系统信息卡牌
.box_card_info {
  width: 20%;
}
</style>